package com.aaa.utils;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import java.util.HashMap;
import java.util.List;

public class Page {

    public Object page(List list,Integer integer,Integer integer1){

        PageHelper.startPage(integer,integer1);

        PageInfo<Object> pageInfo = new PageInfo(list);
        HashMap<Object, Object> hashMap = new HashMap<>();
        hashMap.put("code",0);
        hashMap.put("msg","");
        hashMap.put("count",pageInfo.getTotal());
        hashMap.put("data",pageInfo.getList());
        return hashMap;
    }
}
